package com.baihzi;

import com.baizhi.Application;
import com.baizhi.entity.Product;
import com.baizhi.service.impl.ProductServiceImpl;
import com.github.pagehelper.PageInfo;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class)
public class ProductService {
    @Autowired
    private ProductServiceImpl pd;
    @Test
    public void ma(){
        PageInfo<Product> productPageInfo = pd.selectByPage(1, 4);
        System.out.println(productPageInfo);
    }
    @Test
    public void mb(){
        pd.addImg(new Product(0,null,null,null,null,"1.jpg"));
    }
}
